import React, { Component } from 'react'

export default class UseStateClass extends Component {
    state = {count:0}
    add = ()=>{
		this.setState(state => ({count:state.count+1}))
	}
    render() {
        return (
            <div>
                <button className='returnButton'><a href="/">点击返回主菜单</a></button>
                <h1>useStateClass</h1>
                <p>当前求和为{this.state.count}</p>
                <button onClick={this.add}>点击加1</button>
            </div>
        )
    }
}
